package com.letfox.test.example;

import java.util.Date;

import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import com.letfox.common.util.UUIDHexGenerator;
import com.letfox.finance.dao.AccountRlInoutDao;
import com.letfox.finance.dao.NoviceRlInoutDao;
import com.letfox.finance.enums.FINDelEnums;
import com.letfox.finance.enums.FINInoutTypeEnums;
import com.letfox.finance.model.FINAccountRlInout;
import com.letfox.finance.model.FINNoviceRlInout;
import com.letfox.test.util.MyBatisUtil;

public class NoviceRlInoutExample {

	private NoviceRlInoutDao  noviceRlInoutDao;
	
	@Test
	public void add(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		FINNoviceRlInout finNoviceRlInout = new FINNoviceRlInout();
		finNoviceRlInout.setId(100L);
		finNoviceRlInout.setFinNoviceId("40289a81628ac80401628ac8041b0000");
		finNoviceRlInout.setFinInoutId("40289a816289660f016289660f3b0000");
		finNoviceRlInout.setCreateTime(new Date());
		finNoviceRlInout.setUpdateTime(new Date());
		finNoviceRlInout.setCreateBy("admin");
		finNoviceRlInout.setUpdateBy("admin");
		finNoviceRlInout.setDel(FINDelEnums.UDMDel.EFFECTIVE.getValue());
		noviceRlInoutDao = session.getMapper(NoviceRlInoutDao.class);
		noviceRlInoutDao.insertSelective(finNoviceRlInout);
	}
	
	@Test
	public void update(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		FINNoviceRlInout finNoviceRlInout = new FINNoviceRlInout();
		finNoviceRlInout.setDel(FINDelEnums.UDMDel.DELETE.getValue());
		noviceRlInoutDao = session.getMapper(NoviceRlInoutDao.class);
		noviceRlInoutDao.updateByPrimaryKeySelective(finNoviceRlInout);
	}
	
	@Test
	public void select(){
		SqlSession session = MyBatisUtil.getSqlSession(true);
		noviceRlInoutDao = session.getMapper(NoviceRlInoutDao.class);

		FINNoviceRlInout finNoviceRlInout = noviceRlInoutDao.selectByPrimaryKey(100L);
		System.out.println(finNoviceRlInout.toString());
	}

}
